import request from '../../utils/request'



/**
 * 获取保证金列表
 * @param status
 * @param depositNo
 * @param cstId
 * @param beginTime
 * @param endTime
 * @param page
 * @returns {Promise.<void>}
 */
export async function getDepositsList({status, depositNo, customerno, beginTime, endTime, page}) {

    return request(apiPath.zbtim + "/api/deposits", {
        method: 'get',
        data: {status, depositNo, customerno, beginTime, endTime, page: page.page, size: page.size}
    });
}



/**
 * 保证金详情
 * @param id
 * @returns {Promise.<void>}
 */
export async function getDepositById({id}) {
    return request(apiPath.zbtim + "/api/deposit/"+ id, {
        method: 'get'
    });
}


/**
 * 释放保证金
 * @param id
 * @param depositid
 * @param depositno
 * @param amount
 * @param memo
 * @returns {Promise.<void>}
 */
export async function release({depositid, depositno, amount,  memo}) {
    return request(apiPath.zbtim + "/api/deposit/" + depositid +"/release", {
        method: 'post',
        data: { depositid, depositno, amount,  memo}
    });
}


/**
 * 释放保证金列表
 * @param id
 * @returns {Promise.<void>}
 */
export async function getDepositReleaseList({id, page}) {
    return request(apiPath.zbtim + "/api/deposit/" + id + "/release", {
        method: 'get',
        data: {page: page.page, size: page.size}
    });
}